#include "InfectedFleshTile.h"
#include "BacteriaMob.h"
#include "ImgMgr.h"
#include "Level.h"

InfectedFleshTile::InfectedFleshTile() : Tile()
{

}

void InfectedFleshTile::init(const sf::Vector2f position, ImgMgr *imageManager, Level *level)
{
    m_skin = imageManager->getSprite(5);
    m_skin.setPosition(position);
    m_skin.setScale(2, 2);
    m_name = "InfectedFlesh";
    Tile::init(position, imageManager, level);
}

bool InfectedFleshTile::block() const
{
    return true;
}

void InfectedFleshTile::tick(Player *player, Level *level)
{
    if(m_clockSpawn.getElapsedTime().asMilliseconds() > 2000)
    {
        level->addMob(new BacteriaMob, sf::Vector2f(getPosition().x, getPosition().y - 32));
        m_clockSpawn.restart();
    }
}
